package it.canraid.leaflet.view;

import it.canraid.leaflet.model.StatusPill;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.view.View;

public class StatusMessageView extends View {
    Paint p = new Paint();
    private StatusPill status = new StatusPill("");

    public StatusMessageView(Context context, AttributeSet attrs) {
	super(context, attrs);
    }

    protected void onDraw(Canvas canvas) {
	canvas.drawText(status.desc, 10, 10, p);
    }

    public void refresh(StatusPill status) {
	if (status != null) {
	    this.status = status;
	    invalidate();
	}
    }
}
